home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / Implementation / DocShell / ODDocRef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-13  |  2.0 KB  |  97 lines  |  [TEXT/BROW]

  1. /*
  2.     File:        ODDocRef.h
  3.  
  4.     Contains:    A class for opening OpenDoc documents and drafts in the
  5.                 context of the OpenDoc shell.
  6.  
  7.     Owned by:    Nick Pilch
  8.  
  9.     Copyright:    
  10.  
  11.     Change History (most recent first):
  12.  
  13.          <2>    20.09.1996    NP        1386083: Rewrite document opening code.
  14.          <1>    18.09.1996    NP        first checked in
  15.  
  16.     To Do:
  17. */
  18.  
  19. #ifndef _ODDOCREF_
  20. #define _ODDOCREF_
  21.  
  22.  
  23. #ifndef _ODTYPES_
  24. #include "ODTypes.h"
  25. #endif
  26.  
  27. #ifndef __FILES__
  28. #include <Files.h>
  29. #endif
  30.  
  31. class ODDocument;
  32. class ODSession;
  33. class ODDraft;
  34. class PlatformFile;
  35. class ODContainer;
  36.  
  37. class ODOpenDocumentRef
  38. {
  39.   public:
  40.  
  41.     ODOpenDocumentRef(ODSession*             session,
  42.                         PlatformFile*         document,
  43.                         ODDraftPermissions    permissions);
  44. /*
  45. document is the OpenDoc file to open
  46. */
  47.     ~ODOpenDocumentRef();
  48. /*
  49. Does not close the document! Make sure to call Close first if you have called
  50. Open.
  51. */
  52.     ODDraft*    Open(Environment* ev);
  53. /*
  54. Open the document. If an exception is thrown, the open did not succeed and
  55. */
  56.     void    OpenDraft(Environment* ev, ODDraft* draft);
  57. /*
  58. Open a particular draft of a document.
  59. */
  60. //    void    Save(Environment* ev);
  61. /*
  62. Save the document
  63. */
  64. //    void    Close(Environment* ev);
  65. /*
  66. Close the document. Any changes in the temp draft are thrown out, so you best
  67. call Save before calling Close if any changes to the doc are to be saved.
  68. */
  69. //    ODDocument*    GetDocument();
  70. //    ODDraft*    GetTopDraft();
  71.  
  72.   private:
  73.  
  74.     ODDraft*        AcquireCtrDocTopDraft(Environment* ev);
  75.     void            DocumentOpened(Environment* ev);
  76.     void            AddToRefNumDocNS(Environment* ev);
  77.     void            RemoveFromRefNumDocNS(Environment* ev);
  78.     void            AddToTempDraftNS(Environment* ev);
  79. //    void            RemoveFromTempDraftNS(Environment* ev);
  80.  
  81.     PlatformFile*        fFile;
  82.     ODSession*            fSession;
  83.     ODDraftPermissions    fPermissions;
  84.     ODContainer*        fContainer;
  85.     ODDocument*            fDocument;
  86.     short                fRefNum;
  87.     ODDraft*            fTempDraft;
  88.     ODNameSpaceManager*    fNameSpaceManager;
  89. /*
  90.     don't need to store alias or doc ref num
  91.     should store document, session references. (drafts? or get on the fly?)
  92. */
  93. };
  94.  
  95. #endif /* _ODDOCREF_ */
  96.  
  97.